<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>滴答办公系统-学员详细</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport"
	content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="stylesheet" href="media/layui/css/layui.css" media="all">
<script type="text/javascript" src="media/js/jquery.min.js"></script>
</head>
<body>
	<div class="layui-container" style="margin-top: 5px">
		<form class="layui-form" action="studentadd.do" method="post"><div class="layui-form-item">
				<label class="layui-form-label">学号</label>
				<div class="layui-input-block">
					<div class="layui-form-mid layui-word-aux" id="no">1</div>
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">学员姓名</label>
				<div class="layui-input-block">
					<div class="layui-form-mid layui-word-aux" id="name">小张</div>
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">所属班级</label>
				<div class="layui-input-block">
					<div class="layui-form-mid layui-word-aux" id="class_name">JAVAEE1805</div>
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">性别</label>
				<div class="layui-input-block">
					<div class="layui-form-mid layui-word-aux" id="sex">男</div>
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">邮箱</label>
				<div class="layui-input-inline">
					<div class="layui-form-mid layui-word-aux" id="email">345353543@qq.com</div>
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">手机号</label>
				<div class="layui-input-inline">
					<div class="layui-form-mid layui-word-aux" id="phone">144576800324</div>
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">QQ</label>
				<div class="layui-input-inline">
					<div class="layui-form-mid layui-word-aux" id="qq">34543556765</div>
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">身份证号</label>
				<div class="layui-input-inline">
					<div class="layui-form-mid layui-word-aux" id="cardno">144576768768768768800324</div>
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">毕业学校</label>
				<div class="layui-input-inline">
					<div class="layui-form-mid layui-word-aux" id="school">哈佛大学</div>
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">学历</label>
				<div class="layui-input-inline">
					<div class="layui-form-mid layui-word-aux" id="education">博士后</div>
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">出生日期</label>
				<div class="layui-input-inline">
					<div class="layui-form-mid layui-word-aux" id="birthday">1994-10-10</div>
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">入学日期</label>
				<div class="layui-input-inline">
					<div class="layui-form-mid layui-word-aux" id="createdate">2016-10-10</div>
				</div>
			</div>
		</form>
	</div>


	<script src="media/layui/layui.js"></script>
	<!-- 注意：如果你直接复制所有代码到本地，上述js路径需要改成你本地的 -->
	<script>
    function getQueryVariable(variable) {
      var query = window.location.search.substring(1);
      var vars = query.split("&");
      for (var i = 0; i < vars.length; i++) {
        var pair = vars[i].split("=");
        if (pair[0] == variable) {
          return pair[1];
        }
      }
      return (false);
    }
    
    function init() {
      $.ajax({
        url: "/emp/student/getStudent",
        type: "POST",
        dataType: "json",
        data: {
          id: getQueryVariable("id")
        }, //提交表单的数据
        success: function(res) {
          analyseData(res);
        },
        error: function(XMLHttpRequest, textStatus, errorThrown) {
          alert(XMLHttpRequest.status);
          alert(XMLHttpRequest.readyState);
          alert(textStatus);
        }
      });
    }
    
    init();
    
    function analyseData(data) {
      var no = data.student.no;
      var name = data.student.name;
      var class_name = data.student.class_name;
      var sex = data.student.sex;
      var email = data.student.email;
      var phone = data.student.phone;
      var qq = data.student.qq;
      var cardno = data.student.cardno;
      var school = data.student.school;
      var education = data.student.education;
      var birthday = data.student.birthday;
      var createdate = data.student.createdate;
      
      $("#no").text(no);
      $("#name").text(name);
      $("#class_name").text(class_name);
      $("#sex").text(sex);
      $("#email").text(email);
      $("#phone").text(phone);
      $("#qq").text(qq);
      $("#cardno").text(cardno);
      $("#school").text(school);
      $("#education").text(education);
      $("#birthday").text(birthday);
      $("#createdate").text(createdate);
    }
	</script>
</body>
</html>